<template>
  <div class="hello">
    <section class="main" v-if="1 == 2">
      <!-- <header class="header">
        <div></div>
        <div></div>123
        <div></div>
      </header> -->
      <div class="menu">
        <div class="menu-unit" v-for="item in menus" :key="item.ID">
          <div class="menu-unit-icon"><font-awesome-icon icon="user" /></div>
          {{ item.name }}
        </div>
      </div>

      <div class="main-footer">
        <div class="main-footer-two">
          <div class="menu-unit main-unit-bottom">
            <div class="menu-unit-icon"></div>
          </div>
          <div class="menu-unit main-unit-bottom">
            <div class="menu-unit-icon"></div>
          </div>
          <div class="menu-unit main-unit-bottom">
            <div class="menu-unit-icon"></div>
          </div>
          <div class="menu-unit main-unit-bottom">
            <div class="menu-unit-icon"></div>
          </div>
        </div>

        <div class="main-footer-one">
          <div><font-awesome-icon icon="stream" /></div>
          <div><font-awesome-icon icon="circle" /></div>
          <div><font-awesome-icon icon="reply" /></div>
        </div>
      </div>
    </section>
    <Task></Task>
  </div>
</template>

<script>
import { reactive, toRefs } from "vue";
import axios from "axios";
import Task from "./TaskPage.vue";

export default {
  setup() {
    const state = reactive({
      menus: [],
    });

    let GetMenus = () => {
      var data = {};
      axios
        .post("http://localhost:5078/api/System/GetMenus", data, {})
        .then(function (res) {
          if (res.data.code == 200 && res.data.data) {
            state.menus = res.data.data;
          } else {
            alert(res.data.msg);
          }
        });
    };
    GetMenus();
    return {
      ...toRefs(state),
    };
  },

  name: "IndexPage",

  components: {
    Task,
  },

  props: {
    msg: String,
  },
};
</script>

 <style  >
.header {
  background: rgba(255, 255, 255, 0.7);
}

.main-footer-two {
  width: 100%;
  display: flex;
  justify-content: center;
}

.main-footer-one {
  display: flex;
  justify-content: space-around;
  /* border: 1px #fff solid; */
  /* background-color: #fff; */
  color: #fff;
}
.main-footer-one div {
  width: 33%;
  text-align: center;
  padding: 0.2em;
  font-size: 1.2em;
  /* background-color: rgba(255, 255, 255, 0.9); */
  /* box-shadow: #000 1px 0px 1px 0px; */
}
.main-footer-one div:hover {
  background-color: #409eff;
  color: #fff;
}

.main-footer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  position: fixed;
  bottom: 0;
  width: 100vw;
  background: rgba(255, 255, 255, 0.2);
  /* box-shadow: 3px 3px 6px 3px rgba(0, 0, 0, 0.3); */
  overflow: hidden;
}

.menu {
  width: 80%;
  overflow-x: auto;
  margin: 0px auto;
  display: flex;
  flex-wrap: wrap;
  height: calc(100% - 8.3em);
  padding-left: 12%;
  padding-right: 12%;
}

.menu-unit {
  /* font-size: small; */
  margin-top: 2%;
  margin-bottom: 2%;
  margin-left: 2%;
  margin-right: 2%;
  /* height: 6em;
  width: 6em; */
  text-align: center;
  color: #fff;
}

.menu-unit-icon {
  border-radius: 15px;
  background-color: #fff;

  color: #000;

  margin-bottom: 0.1em;
  width: 2.5em;
  height: 2.5em;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main {
  /* background: rgba(255, 255, 255, 0.4); */
  height: 100vh;
  width: 100%;
  overflow: hidden;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.main-unit-bottom {
  margin-top: 1em;
  margin-bottom: 0em;
}

@media screen and (max-width: 300px) and (min-width: 200px) {
  .menu {
    width: 16.7em;

    height: calc(100% - 6em);
    padding: 0;
  }
  .menu-unit {
    /* height: 3.2em;
    width: 3.2em; */
    border-radius: 10px;
    margin: 0.405em;
    font-size: small;
  }
  .main-unit-bottom {
    margin-top: 0.5em;
    margin-bottom: 0em;
  }
  .main-footer {
    display: flex;
    justify-content: center;

    position: fixed;
    bottom: 0;
    width: 100vw;
  }

  .menu-unit-icon {
    border-radius: 10px;

    margin-bottom: 0.1em;
    width: 2.4em;
    height: 2.4em;
    font-size: 1.8em;

    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media screen and (max-width: 400px) and (min-width: 300px) {
  .menu {
    width: 22em;
    height: calc(100% - 7.95em);
    padding: 0;
  }
  .menu-unit {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: 0.5em;
    margin-right: 0.5em;
  }
  .main-unit-bottom {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
  }
  .main-footer {
    display: flex;
    justify-content: center;

    position: fixed;

    /* background-color: #fff; */
  }
  .menu-unit-icon {
    border-radius: 15px;

    width: 2.245em;
    height: 2.245em;

    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media screen and (max-width: 500px) and (min-width: 400px) {
  .menu {
    width: 24em;
    height: calc(100% - 8em);
    padding: 0;
  }
  .menu-unit {
    /* height: 5em;
    width: 5em; */

    margin: 0.5em;
  }
  .main-unit-bottom {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
  }
  .main-footer {
    display: flex;
    justify-content: center;
    height: 8em;
    position: fixed;
    bottom: 0;
    width: 100vw;
  }
}

@media screen and (max-width: 800px) and (min-width: 700px) {
  .menu {
    width: 42em;
    height: calc(100% - 8em);
    padding: 0;
  }
  .menu-unit {
    /* height: 5em;
    width: 5em; */

    margin: 1em;
  }
  .main-unit-bottom {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
  }
  .main-footer {
    display: flex;
    justify-content: center;
    height: 8em;
    position: fixed;
    bottom: 0;
    width: 100vw;
  }
}

@media screen and (max-width: 1000px) and (min-width: 900px) {
  .menu {
    width: 49em;
    height: calc(100% - 10em);
    padding: 0;
  }
  .menu-unit {
    /* height: 5em;
    width: 5em; */

    margin: 1em;
  }
  .main-unit-bottom {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
  }
  .main-footer {
    display: flex;
    justify-content: center;
    height: 10em;
    position: fixed;
    bottom: 0;
    width: 100vw;
  }
}

body {
  margin: 0px;
  padding: 0px;
  background-image: url("/static/imgs/backageimg5.jpg");
  /* background-color: #409eff; */
  width: 100vw;
  height: 100vh;
  background-size: 100vw 100vh;
}

/*修改滚动条样式*/
div::-webkit-scrollbar {
  width: 0px;
  height: 10px;
  /**/
}

div::-webkit-scrollbar-track {
  background: rgb(239, 239, 239);
  border-radius: 2px;
}

div::-webkit-scrollbar-thumb {
  background: #fff;
  border-radius: 10px;
}

div::-webkit-scrollbar-thumb:hover {
  background: #333;
}

div::-webkit-scrollbar-corner {
  background: #179a16;
}
</style>
